// components/counter/counter.js

import eventStore from '../../utils/eventStore';

const globalThis = getApp();
globalThis.globalData.userInfo = 555
console.log('globalThis', globalThis.globalData);


Component({
  /**
   * 组件的属性列表
   */
  properties: {
    // count: Number
  },
    

  /**
   * 组件的初始数据
   */
  data: {
    count: 0
  },

  /**
   * 组件的方法列表
   */
  attached(){
    eventStore.on('count-add', (count)=>{
      this.setData({
        count
      })
    })
  },
  methods: {
    handleViewTap: function(){
      eventStore.emit('count-add', this.data.count+4)
    }
  }
})
